<?php 

$username = $_POST['username'];
$password = $_POST['password'];

if($username&&$password)
{
	$connect = mysql_connect("localhost","root","") or die("Couldnt connect");
	mysql_select_db("sportfieldsdb") or die("Couldnt find db");
	$query = mysql_query("SELECT * FROM admin_login");
	
	$numrows = mysql_num_rows($query);
	if($numrows!=0)
	{
		while ($row = mysql_fetch_assoc($query))
		{
			$dbusername = $row['username'];
			$dbpassword = $row['password'];
		}
		if($username==$dbusername&&$password==$dbpassword)
		{
			echo "You are in";
		}
		else echo "Incorect password";
	}
	else die ("That user doesnt exist!");
	echo $numrows;
}

else die("Please enter a username and password");

?>